package com.runa.protocol.dto;

import com.alibaba.fastjson.JSON;
import com.runa.monitor.comm.dto.newComm.ValveVO;

import java.lang.reflect.Field;
import java.util.HashMap;

/**
 * 2024/8/27 9:49
 * zhangYB
 */
public class ResponseContent extends HashMap<String, Object> {

    private boolean success = true;

    private Integer indexNo;

    private String id;

    private String serial;

    private String model;

    public static void main(String[] args) {
        ResponseContent responseContent = new ResponseContent();
        responseContent.setSuccess(false);
        responseContent.put("valveSerial", "1");
        String s = JSON.toJSONString(responseContent);
        System.out.println(s);
        ValveVO valveVO = JSON.parseObject(s, ValveVO.class);
        System.out.println(JSON.toJSONString(valveVO));
    }

    public ValveVO getValve() {
        ValveVO valveVO = JSON.parseObject(JSON.toJSONString(this), ValveVO.class);
        valveVO.setSuccess(success);
        valveVO.setValveSerial(serial);
        return valveVO;
    }

    public ResponseContent() {
        setSuccess(true);
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Integer getIndexNo() {
        return indexNo;
    }

    public void setIndexNo(Integer indexNo) {
        this.indexNo = indexNo;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        put("serial", serial);
        this.serial = serial;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }








}
